UpdatePurviewWindow = function(){
	var this_window = this;
	
	
	this.setData = function(data){
		form.form.setValues(data);
	}
	
	var save = function(){
		if(!form.form.isValid()){
			return false;
		}
		var params = form.form.getFieldValues();
		Ajax({
			url : "manager/updatePurview.action",
			params : params,
			maskTarget : this_window,
			window : this_window,
			grid : managerPanel
		});
	}
	
	var form = new Ext.form.FormPanel({
		padding : 5,
		frame : true,
		labelAlign : "right",
		labelWidth : 60,
		defaults : {
			anchor : "95%",
			allowBlank : false
		},
		items : [{
			xtype : 'hidden',
			name : "manager.id"
		},{
			xtype : 'textfield',
			fieldLabel : "管理员名",
			readOnly : true,
			name : "manager.name"
		},{
			xtype : "textfield",
			fieldLabel : "权限",
			name : "manager.purview"
		}]
	});
	
	UpdatePurviewWindow.superclass.constructor.call(this, {
		title : "修改管理员权限",
		iconCls : "edit",
		width : 350,
		border : false,
		autoHeight : true,
		closeAction : "hide",
		modal : true,
		items : [form],
		buttons : [{
			text : "保存",
			handler : save
		},{
			text : "取消",
			handler : function(){
				this_window.hide();
			}
		}]
	});
};
Ext.extend(UpdatePurviewWindow, Ext.Window);
var updatePurviewWindow = new UpdatePurviewWindow();